import {$post,$postParms} from '@/utils/require'
import {message} from "ant-design-vue";
export enum LabBorrowAddApi{
    getlabBorrowList="/student/labBorrow/list",
    addLabBorrow="/student/labBorrow/add",
    editLabBorrow="/student/labBorrow/edit",
    finishedLabBorrow="/student/labBorrow/finished",
    getAvaLabBorrow="/student/lab/list",

}
export let $getlabBorrowList = async (body?:any,params?:any)=>{
    try{
        return await $postParms(LabBorrowAddApi.getlabBorrowList,body, params);
    }catch (error){
        message.error("查询失败");
    }
}
/**
 * 添加addLabBorrow表单
 * @param body
 * @param params
 */
export let $addLabBorrow = async (body?:any,params?:any)=>{

    try{
        return await $postParms(LabBorrowAddApi.addLabBorrow,body, params);
    }catch (error){
        message.error("查询失败");
    }
}
/**
 * 编辑addLabBorrow表单
 * @param body
 * @param params
 */
export let $editLabBorrow = async (body?:any,params?:any)=>{

    try{
        return await $postParms(LabBorrowAddApi.editLabBorrow,body, params);
    }catch (error){
        message.error("查询失败");
    }
}
/**
 * 获取空闲的实验室列表
 * @param body
 * @param params
 */
export let $getAvaLabBorrow = async (body?:any,params?:any)=>{
    try{
        return await $postParms(LabBorrowAddApi.getAvaLabBorrow,body, params);
    }catch (error){
        message.error("查询失败");
    }
}
export let $finishedLabBorrow = async  (body?:any,params?:any)=>{
    try{
        return await $postParms(LabBorrowAddApi.finishedLabBorrow,body, params);
    }catch (error){
        message.error("确认失败");
    }
}


